﻿@Html.DevExpress().GridView(
            settings =>
            {
                settings.Name = "gvEditing";
                settings.KeyFieldName = "FPerformancePrjEntryID";
                settings.CallbackRouteValues = new { Controller = "Performance", Action = "PerformancePrjEntryPartial" };
                settings.Width =System.Web.UI.WebControls.Unit.Percentage(96);

                settings.Columns.Add(column =>
                {
                    column.Caption = "#";
                    column.SetHeaderTemplateContent(c =>
                    {
                        Html.DevExpress().HyperLink(s => { s.Name = "linkAdd"; s.Properties.Text = "新增"; s.Properties.ClientSideEvents.Click = "PerformancePrjEntryAdd"; s.Style.Add(HtmlTextWriterStyle.Cursor, "pointer"); }).GetHtml();                       
                    });
                    column.SetDataItemTemplateContent(c =>
                    {
                        Html.DevExpress().HyperLink(s => { s.Name = "linkDel" + c.VisibleIndex; s.Properties.Text = "删除"; s.Properties.ClientSideEvents.Click = "function(){PerformancePrjEntryDel('" + DataBinder.Eval(c.DataItem, "FPerformancePrjEntryID") + "')}"; s.Style.Add(HtmlTextWriterStyle.Cursor, "pointer"); }).GetHtml();
                    });
                    column.Settings.AllowDragDrop = DefaultBoolean.False;
                    column.Settings.AllowSort = DefaultBoolean.False;
                    column.Width = 70;
                });

                settings.Columns.Add("FAttachOldFileName", "标题");
                settings.Columns.Add("FPerformanceFileClsName", "所属类别");
                settings.Columns.Add("FInsDate", "发布时间");

                settings.SettingsBehavior.AllowSort = false;
                settings.SettingsBehavior.AllowDragDrop = false;
                settings.SettingsBehavior.AllowSelectByRowClick = false;
                settings.SettingsLoadingPanel.Text = "数据读取中...";
                settings.SettingsBehavior.AllowClientEventsOnLoad = false;
                settings.SettingsBehavior.AllowFocusedRow = true;


                settings.ClientSideEvents.BeginCallback = "function(s,e){OnBeginCallback(s,e)}";
                settings.CommandColumn.Visible = false;
                //settings.CommandColumn.ShowSelectCheckbox = true;
                
                //settings.ClientSideEvents.RowDblClick = "SelectionChanged";

                                                               
                
            }).Bind(Model).GetHtml()

